package com.ruoyi.project.mydy.kindclass.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.kindclass.mapper.DlKindClassMapper;
import com.ruoyi.project.mydy.kindclass.domain.DlKindClass;
import com.ruoyi.project.mydy.kindclass.service.IDlKindClassService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 类型分类Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlKindClassServiceImpl implements IDlKindClassService 
{
    @Autowired
    private DlKindClassMapper dlKindClassMapper;

    /**
     * 查询类型分类
     * 
     * @param id 类型分类主键
     * @return 类型分类
     */
    @Override
    public DlKindClass selectDlKindClassById(Long id)
    {
        return dlKindClassMapper.selectDlKindClassById(id);
    }

    /**
     * 查询类型分类列表
     * 
     * @param dlKindClass 类型分类
     * @return 类型分类
     */
    @Override
    public List<DlKindClass> selectDlKindClassList(DlKindClass dlKindClass)
    {
        return dlKindClassMapper.selectDlKindClassList(dlKindClass);
    }

    /**
     * 新增类型分类
     * 
     * @param dlKindClass 类型分类
     * @return 结果
     */
    @Override
    public int insertDlKindClass(DlKindClass dlKindClass)
    {
        dlKindClass.setCreateTime(DateUtils.getNowDate());
        return dlKindClassMapper.insertDlKindClass(dlKindClass);
    }

    /**
     * 修改类型分类
     * 
     * @param dlKindClass 类型分类
     * @return 结果
     */
    @Override
    public int updateDlKindClass(DlKindClass dlKindClass)
    {
        return dlKindClassMapper.updateDlKindClass(dlKindClass);
    }

    /**
     * 批量删除类型分类
     * 
     * @param ids 需要删除的类型分类主键
     * @return 结果
     */
    @Override
    public int deleteDlKindClassByIds(String ids)
    {
        return dlKindClassMapper.deleteDlKindClassByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除类型分类信息
     * 
     * @param id 类型分类主键
     * @return 结果
     */
    @Override
    public int deleteDlKindClassById(Long id)
    {
        return dlKindClassMapper.deleteDlKindClassById(id);
    }
}
